package day21.pack5;

import java.util.concurrent.CountDownLatch;

public class Test {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch = new CountDownLatch(2);
        Runnable r = ()-> {
            for (int i = 0; i < 100000; i++) {
                Counter.count++;
            }
            countDownLatch.countDown();
        };
        new Thread(r).start();
        new Thread(r).start();
        countDownLatch.await();
        System.out.println(Counter.count);
    }
}
